﻿using AutoMapper;
using WMS.Api.Application.Commands.Users;
using WMS.Domain;
using ThreeTeams.Domain.ThreeTeams.Domain.Entities;
using WMS.Api.Application.Commands;
using WMS.Domain;

namespace WMS.Api
{
    /// <summary>
    /// Automapper的配置文件
    /// </summary>
    public class MappingProfiles : Profile
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public MappingProfiles()
        {
            //todo add mapping relationship
            //CreateMap<InsertDatasRequestDTO, HotelTest>();
            //CreateMap<UpdateDatasRequestDTO, HotelTest>();
            //CreateMap<HotelTest, IServices.ResponseDTO.GetDataResponseDTO>();
            CreateMap<User, AddUserCommand>().ReverseMap();



            // 产品映射
            CreateMap<Product, ProductDto>();
            CreateMap<ProductDto, Product>();

            // 箱子型号映射
            CreateMap<BoxType, BoxTypeDto>();
            CreateMap<BoxTypeDto, BoxType>();

            // 入库类型映射
            CreateMap<InboundType, InboundTypeDto>();
            
            // 入库单映射
            CreateMap<InboundOrder, InboundOrderDto>();
            CreateMap<InboundOrderCreateDto, InboundOrder>();
            CreateMap<InboundOrderUpdateDto, InboundOrder>();
            
            // 入库明细映射
            CreateMap<InboundItem, InboundItemDto>();
            CreateMap<InboundItemCreateDto, InboundItem>();
            CreateMap<InboundItemUpdateDto, InboundItem>();
            
            // 入库附件映射
            CreateMap<InboundAttachment, InboundAttachmentDto>();
        }
    }
}
